using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace sCicero
{
    public partial class classes_new : UserControl
    {
        private sCicero.scicero m_osCicero;
        public classes_new(ref sCicero.scicero osCicero)
        {
            m_osCicero = osCicero;
            InitializeComponent();
        }

        private void button_new_class_Click(object sender, EventArgs e)
        {
            if (m_osCicero.Classes.New(textBox_new_class.Text.Trim()) == sCicero.Errorcode.NOERROR)
            {
                m_osCicero.Event.Raise_ClassCreated(this, textBox_new_class.Text.Trim());
                m_osCicero.Event.Raise_UpdateRequest(this, "Ny klass, " + textBox_new_class.Text.Trim() + " sparad", false);
                textBox_new_class.Text = "";
            }
        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {
            textBox_new_class.Focus();
        }
    }
}
